#ifndef DISCIPLINE_H
#define DISCIPLINE_H

#include <QString>
#include <QStringList>
#include <QVector>
#include <QList>
#include "globals.h"
#include "earthdawn.h"
#include "talent.h"
#include "specialization.h"

class Discipline
{
public:
  struct Circle
  {
    QMap<ed::Characteristic,int> _bonuses;
    QMap<Talent,bool> _talents;
    QStringList _karmaUsages;
    int _karmaBonus;

    Circle()
      : _karmaBonus(0)
    {}
  };

  Discipline();

  RW(QString,name)
  RW(P(QList<ed::Race>),racialRestrictions)
  RW(P(QList<ed::Attribute>),baseAttributes)
  RW(QStringList,arts)
  RW(P(QPair<int,int>),endurance)
  W(P(QVector<Circle>),circles)

  bool operator==(const Discipline& other) const;
  bool operator<(const Discipline& other) const;
  operator QString() const;

  QList<Talent> talents(int circle) const;
  QMap<ed::Characteristic,int> bonuses(int circle) const;
  int karmaBonus(int circle) const;
  QStringList karmaUsages(int circle) const;

  bool isDiscipline(const Talent& t) const;
  QList<Specialization> specializations() const;

  int talentCircle(const Talent& t) const;
};

uint qHash(const Discipline& discipline);

#endif // DISCIPLINE_H
